package sf;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.function.Supplier;

@Slf4j
public class AssertException {

    public static <T> void exception(Supplier<T> func) {
        Exception ex = null;
        try {
            func.get();
        } catch (Exception e) {
            log.error("not to be throw", e);
            ex = e;
        }
        if (ex == null) {
            throw new RuntimeException("no exception");
        }
    }
}
